package com.ftg.learn.chapter15.factorypattern.color;

import com.ftg.learn.chapter15.factorypattern.AbstractFactory;
import com.ftg.learn.chapter15.factorypattern.shape.Shape;
import com.ftg.learn.chapter15.factorypattern.shape.ShapeLv;

/**
 * @author KangJx
 * @date 2021/7/28
 */
public class ColorFactory extends AbstractFactory {


    @Override
    public Shape getShapeFactory(ShapeLv lv) {
        return null;
    }

    @Override
    public Color getColorFactory(Colorlv lv) {
        if(lv.equals(Colorlv.GREEN)){
            return new Green();
        }else if(lv.equals(Colorlv.YELLOW)){
            return new Yellow();
        }
        return null;
    }
}
